#ifndef SPACE_H
#define SPACE_H

#include <memory>
#include <iostream>
#include <QWidget>

#include <QPaintEvent>
#include <QPainter>

#include "../Instruction.h"

using namespace std;

namespace talisman_map
{

class Space : public QWidget
{
	Q_OBJECT
public:

	Space(QWidget *parent = 0);
	virtual ~Space();
	inline string getDescription(void) const {return mDescription; };
	inline void setDescription(string iSpaceDescription) { mDescription = iSpaceDescription; };

	inline Space * getNextSpace(void) const {return mNextSpace; };
	inline Space * getPrevSpace(void) const {return mPrevSpace; };
	inline void setNextSpace(Space * iNextSpace) {mNextSpace = iNextSpace; };
	inline void setPrevSpace(Space * iPrevSpace) {mPrevSpace = iPrevSpace; };
	inline void setColor(QColor iColor) {mColor = iColor; };
	inline QColor getColor(void) const { return mColor; };
	inline void setPicture(std::string iFileName) { picture.load(iFileName.c_str()); };
	inline void setInstruction(Instruction *iInstr) { mInstruction = iInstr; };
	inline Instruction* getInstruction(void) const {return mInstruction; };
	virtual void resetReferences(void);

protected:
	virtual void paintEvent(QPaintEvent *event) override;
	QImage picture;

private:
	string mDescription;
	Space * mNextSpace;
	Space * mPrevSpace;
	QColor mColor;

	Instruction *mInstruction;
};

}

#endif